package com.hopu.oa.dao.plan;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hopu.oa.entity.management.AoaStatusList;
import com.hopu.oa.entity.management.AoaTypeList;
import com.hopu.oa.entity.plan.AoaPlanList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface AoaPlanListDao extends BaseMapper<AoaPlanList> {

    //查询类型
    @Select("select * from aoa_type_list where aoa_type_list.type_model ='aoa_plan_list'")
    List<AoaTypeList> selectTypeList();

    //查询状态
    @Select("select * from aoa_status_list where aoa_status_list.status_model ='aoa_plan_list'")
    List<AoaStatusList> selectStatusList();

    //我的申请分页模糊搜素
    List<AoaPlanList> selectAll(@Param("userId") Integer userId, String baseKey, @Param("index") Integer index, @Param("size") Integer size, Integer type, Integer status, Integer time);


    @Select("select * from aoa_type_list where type_name = #{name}")
    AoaTypeList selectTypeId(String name);

    @Select("select * from aoa_status_list where  status_model = 'aoa_plan_list' and status_name = #{name}")
    AoaStatusList selectStatusId(String name);

    @Select("select * from aoa_plan_list where plan_id = #{pid}")
    AoaPlanList selectByPid(Integer pid);


}